{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "# Console related imports.\n",
    "from subprocess import Popen, PIPE\n",
    "import os\n",
    "from IPython.utils.py3compat import bytes_to_str, string_types\n",
    "\n",
    "# Widget related imports.\n",
    "import ipywidgets as widgets\n",
    "from IPython.display import display"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Define function to run a process without blocking the input."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "def read_process(process, append_output):\n",
    "    \"\"\" Try to read the stdout and stderr of a process and render it using \n",
    "    the append_output method provided\n",
    "    \n",
    "    Parameters\n",
    "    ----------\n",
    "    process: Popen handle\n",
    "    append_output: method handle\n",
    "        Callback to render output.  Signature of\n",
    "        append_output(output, [prefix=])\"\"\"\n",
    "    \n",
    "    try:\n",
    "        stdout = process.stdout.read()\n",
    "        if stdout is not None and len(stdout) > 0:\n",
    "            append_output(stdout, prefix='    ')\n",
    "    except:\n",
    "        pass\n",
    "        \n",
    "    try:\n",
    "        stderr = process.stderr.read()\n",
    "        if stderr is not None and len(stderr) > 0:\n",
    "            append_output(stderr, prefix='ERR ')\n",
    "    except:\n",
    "        pass\n",
    "\n",
    "\n",
    "def set_pipe_nonblocking(pipe):\n",
    "    \"\"\"Set a pipe as non-blocking\"\"\"\n",
    "    try:\n",
    "        import fcntl\n",
    "        fl = fcntl.fcntl(pipe, fcntl.F_GETFL)\n",
    "        fcntl.fcntl(pipe, fcntl.F_SETFL, fl | os.O_NONBLOCK)\n",
    "    except:\n",
    "        pass\n",
    "\n",
    "kernel = get_ipython().kernel\n",
    "def run_command(command, append_output, has_user_exited=None):\n",
    "    \"\"\"Run a command asyncronously\n",
    "    \n",
    "    Parameters\n",
    "    ----------\n",
    "    command: str\n",
    "        Shell command to launch a process with.\n",
    "    append_output: method handle\n",
    "        Callback to render output.  Signature of\n",
    "        append_output(output, [prefix=])\n",
    "    has_user_exited: method handle\n",
    "        Check to see if the user wants to stop the command.\n",
    "        Must return a boolean.\"\"\"\n",
    "    \n",
    "    # Echo input.\n",
    "    append_output(command, prefix='>>> ')\n",
    "    \n",
    "    # Create the process.  Make sure the pipes are set as non-blocking.\n",
    "    process = Popen(command, shell=True, stdout=PIPE, stderr=PIPE)\n",
    "    set_pipe_nonblocking(process.stdout)\n",
    "    set_pipe_nonblocking(process.stderr)\n",
    "    \n",
    "    # Only continue to read from the command \n",
    "    while (has_user_exited is None or not has_user_exited()) and process.poll() is None:\n",
    "        read_process(process, append_output)\n",
    "        kernel.do_one_iteration() # Run IPython iteration.  This is the code that\n",
    "                                  # makes this operation non-blocking.  This will\n",
    "                                  # allow widget messages and callbacks to be \n",
    "                                  # processed.\n",
    "        \n",
    "    # If the process is still running, the user must have exited.\n",
    "    if process.poll() is None:\n",
    "        process.kill()\n",
    "    else:\n",
    "        read_process(process, append_output) # Read remainer\n",
    "        \n",
    "    \n",
    "        \n",
    "        "
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Create the console widgets without displaying them."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "console_container = widgets.VBox(visible=False)\n",
    "console_container.padding = '10px'\n",
    "\n",
    "output_box = widgets.Textarea()\n",
    "output_box.height = '400px'\n",
    "output_box.font_family = 'monospace'\n",
    "output_box.color = '#AAAAAA'\n",
    "output_box.background_color = 'black'\n",
    "output_box.width = '800px'\n",
    "\n",
    "input_box = widgets.Text()\n",
    "input_box.font_family = 'monospace'\n",
    "input_box.color = '#AAAAAA'\n",
    "input_box.background_color = 'black'\n",
    "input_box.width = '800px'\n",
    "\n",
    "console_container.children = [output_box, input_box]"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Hook the process execution methods up to our console widgets."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "\n",
    "def append_output(output, prefix):\n",
    "    if isinstance(output, string_types):\n",
    "        output_str = output\n",
    "    else:\n",
    "        output_str = bytes_to_str(output)\n",
    "    output_lines = output_str.split('\\n')\n",
    "    formatted_output = '\\n'.join([prefix + line for line in output_lines if len(line) > 0]) + '\\n'\n",
    "    output_box.value += formatted_output\n",
    "    output_box.scroll_to_bottom()\n",
    "    \n",
    "def has_user_exited():\n",
    "    return not console_container.visible\n",
    "\n",
    "def handle_input(sender):\n",
    "    sender.disabled = True\n",
    "    try:\n",
    "        command = sender.value\n",
    "        sender.value = ''\n",
    "        run_command(command, append_output=append_output, has_user_exited=has_user_exited)\n",
    "    finally:\n",
    "        sender.disabled = False\n",
    "        \n",
    "input_box.on_submit(handle_input)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Create the button that will be used to display and hide the console.  Display both the console container and the new button used to toggle it."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {
    "collapsed": true
   },
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAA9oAAAC/CAYAAAABxqQzAAAYTUlEQVR4Xu3dd2jd5RoH8Dc1JiriQgxqXGguKtZBoyC4tW5RUREHjrpw14W4B4gD0bonxT1wK4hat+LAaNX+16BWCGpEcaBoQui5vr+Lob20vbb3nOZ98vvkr15M3vO8n+e54jfP75y2JV8ECBAgQIAAAQIECBAgQIBA0wTamnaSgwgQIECAAAECBAgQIECAAIEkaBsCAgQIECBAgAABAgQIECDQRAFBu4mYjiJAgAABAgQIECBAgAABAoK2GSBAgAABAgQIECBAgAABAk0UELSbiOkoAgQIECBAgAABAgQIECAgaJsBAgQIECBAgAABAgQIECDQRIH5gnZfX9/RbW1t6zfxfEfVTKDRaMzp7e29v2bXdl0CBAgQIECAAAECBAiMCowG7YGBgcbw8HDq7OzEQ2CJBYaGhlJHR0fq7u72tMQSK/pBAgQIECBAgAABAgQiC4yGob+22Y1JkyZFvovaCxH4+OOP019bbUG7kH4ogwABAgQIECBAgACBpSsgaC9d71q8mqBdiza7JAECBAgQIECAAAECCxEQtI1G0wUE7aaTOpAAAQIECBAgQIAAgUACgnagZkUpVdCO0il1EiBAgAABAgQIECDQCgFBuxWqNT9T0K75ALg+AQIECBAgQIAAgZoLCNo1H4BWXF/QboWqMwkQIECAAAECBAgQiCIgaEfpVKA6Be1AzVIqAQIECBAgQIAAAQJNFxC0m07qQEHbDBAgQIAAAQIECBAgUGcBQbvO3W/R3QXtFsE6lgABAgQIECBAgACBEAKCdog2xSpS0I7VL9USIECAAAECBAgQINBcgWKD9gcffJBeeeWVtNJKK6V33nknDQ4Opnfffbe5t1/Eae+//356/fXX09prr52WWWaZ9Pvvv6cff/wxXXTRRS2v4aeffkp33XVX+vPPP9Pll1/e8tdr9gsI2s0WdR4BAgQIECBAgAABApEEigzaf/zxRzrssMPSE088kZZddtk0PDyczjjjjHTnnXdWtj/88EOaNWtW2nnnnRfLOgfnzTffPK2++uqL/LnnnnsuPf/88+n2229PnZ2d1ff++uuvVQ333XffYr3mkn7zY489lj777LN09dVXL+kRY/ZzgvaY0XthAgQIECBAgAABAgQKECgyaH/33XfpoIMOSg899FDaYIMNKqZXX3017bbbblXoPuecc9K+++6b9thjj39M+P3336djjjkmPfDAA4sM2r/88kvaZ5990g033JC22Wab+c7PNey6666prW2U7R+//uJ+47PPPps+/PBDQXtx4Xw/AQIECBAgQIAAAQIExligyKCdTfL2eObMmemkk05Khx56aLXZzl+ffvppuuqqq9Kmm26adtlll7Thhhume+65p/rfr732WrrgggvSCiusUD16nb9ycM7hfL/99kuXXnppOv7449N2222XNt544wXS5032lVdemfKj43+/5oK+8cEHH6z++cDAQFpxxRXTiSeemL788st0/fXXpx122CHNnj07ffLJJ+n0009PkydPTl988UVVX96QP/XUU9XGPH8t6JwJEyakeYP23Llz06OPPlo9wp7DfjbZeuutx3h0Fv7yNtrFtkZhBAgQIECAAAECBAgsBYFig3Z+f3J+VDwHzDXXXDNdfPHFqbe3tyKZOnVq2muvvaqNdn6UOwfeI444Il1zzTWpq6srHXvssWn69Onp7bffTnfccUfKG/K8Gc8BOwfYRT06fvfdd6eHH344vfXWWwvlf+GFF9KcOXOqEJ2/jjzyyLT//vunQw45JJ188slViD/zzDPTiy++WAXqfI8cwHP9O+20U1XDAQcckBZ1zrxBO/95ueWWS3vuuWd644030rXXXludnQN5iV+CdoldURMBAgQIECBAgAABAktLoNig/TfAV199VQXLzz//vHrse6ONNpovaOfvy0E6f3ha3hhvttlm1cb3kUceqbbIl1xyyajlPwnaeducX++9995L7e3tC+zDKaecUm2pDzzwwOqf33vvvdX2/bbbbpuvtr6+vnTTTTdVW+t83vnnn1/9guC4446rfiGwqHPmDdrnnntu2mKLLdIaa6yRfvvtt+qR8vyhbCuvvPLSmpPFeh1Be7G4fDMBAgQIECBAgAABAuNMoMignd9P/c0336Qtt9yy4h4ZGUlHHXVU2n333av3Wc+70X7zzTerkH3eeeelW265JS2//PL/V9DOj4Ln94fns/77Pdp5y95oNNJZZ52VJk2alE444YSqvhzO8/Y8h+p5a8tBe9q0adV7zfMdvv3223TzzTenjz76qNrUX3HFFQs9Z96gnc/MNW2//fajHvkPC/tFwFjPqKA91h3w+gQIECBAgAABAgQIjKVAkUE7/1Ve+cPI8qPgf3/w2Kmnnlo9or3tttums88+u3p/dg6eF154YRXA83uw8/a6u7u7CuX5k8P7+/vTZZddNuq74447pvxp3vk93IvaBucwnDfQ+bHzVVddtfr5oaGh9NJLL1WPiOdPQ3/yySerR8xz2L3xxhvTJptsUj3anR8Z33vvvavH2ucN2o8//ng6+OCDq/dZ5+Cc/5yD98LOmTdo5+18fs383vF11lmnevQ8WwjaY/l/Ha9NgAABAgQIECBAgACBBQsUG7TzJ3/nDzjLW+X8uPS6666bDj/88OoWOZzmjfBpp51WfdjZrbfeWr33Ob/3Om+3cxDPj5nnR8evu+661NPTU/1cDuL5MfP8CHd+BH1hX3lrn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jGMBQXscN9fVCIxHAUF7PHbVnQgQIECAAAEC40tA0B5f/XQbAuNeQNAe9y12QQIECBAgQIBAeAFBO3wLXYBAvQQE7Xr1220JECBAgAABAhEFBO2IXVMzgRoLCNo1br6rEyBAgAABAgSCCAjaQRqlTAIE/iMgaJsEAgQIECBAgACB0gUE7dI7pD4CBOYTELQNBAECBAgQIECAQOkCgnbpHVIfAQKCthkgQIAAAQIECBAIJSBoh2qXYgkQsNE2AwQIECBAgAABAqULCNqld0h9BAjYaJsBAgQIECBAgACBUAKCdqh2KZYAARttM0CAAAECBAgQIFC6gKBdeofUR4CAjbYZIECAAAECBAgQCCUgaIdql2IJELDRNgMECBAgQIAAAQKlCwjapXdIfQQI2GibAQIECBAgQIAAgVACgnaodimWAAEbbTNAgAABAgQIECBQuoCgXXqH1EeAgI22GSBAgAABAgQIEAglIGiHapdiCRCw0TYDBAgQIECAAAECpQsI2qV3SH0ECNhomwECBAgQIECAAIFQAoJ2qHYplgABG20zQIAAAQIECBAgULqAoF16h9RHgICNthkgQIAAAQIECBAIJSBoh2qXYgkQsNE2AwQIECBAgAABAqULCNqld0h9BAjYaJsBAgQIECBAgACBUAKCdqh2KZYAARttM0CAAAECBAgQIFC6gKBdeofUR4CAjbYZIECAAAECBAgQCCUgaIdql2IJELDRNgMECBAgQIAAAQKlCwjapXdIfQQI2GibAQIECBAgQIAAgVACgnaodimWAAEbbTNAgAABAgQIECBQuoCgXXqH1EeAgI22GSBAgAABAgQIEAglIGiHapdiCRCw0TYDBAgQIECAAAECpQsI2qV3SH0ECNhomwECBAgQIECAAIFQAoJ2qHYplgABG20zQIAAAQIECBAgULqAoF16h9RHgICNthkgQIAAAQIECBAIJSBoh2qXYgkQsNE2AwQIECBAgAABAqULCNqld0h9BAjYaJsBAgQIECBAgACBUAKCdqh2KZYAARttM0CAAAECBAgQIFC6gKBdeofUR4CAjbYZIECAAAECBAgQCCUgaIdql2IJELDRNgMECBAgQIAAAQKlCwjapXdIfQQI2GibAQIECBAgQIAAgVACgnaodimWAAEbbTNAgAABAgQIECBQuoCgXXqH1EeAgI22GSBAgAABAgQIEAglIGiHapdiCRCw0TYDBAgQIECAAAECpQsI2qV3SH0ECNhomwECBAgQIECAAIFQAoJ2qHYplgABG20zQIAAAQIECBAgULqAoF16h9RHgICNthkgQIAAAQIECBAIJSBoh2qXYgkQsNE2AwQIECBAgAABAqULCNqld0h9BAjYaJsBAgQIECBAgACBUAKCdqh2KZYAARttM0CAAAECBAgQIFC6gKBdeofUR4CAjbYZIECAAAECBAgQCCUgaIdql2IJELDRNgMECBAgQIAAAQKlCwjapXdIfQQI2GibAQIECBAgQIAAgVACgnaodimWAAEbbTNAgAABAgQIECBQuoCgXXqH1EeAgI22GSBAgAABAgQIEAglIGiHapdiCRCw0TYDBAgQIECAAAECpQsI2qV3SH0ECNhomwECBAgQIECAAIFQAoJ2qHYplgABG20zQIAAAQIECBAgULqAoF16h9RHgICNthkgQIAAAQIECBAIJSBoh2qXYgkQsNE2AwQIECBAgAABAqULCNqld0h9BAjYaJsBAgQIECBAgACBUAKCdqh2KZYAARttM0CAAAECBAgQIFC6gKBdeofUR4CAjbYZIECAAAECBAgQCCUgaIdql2IJELDRNgMECBAgQIAAAQKlCwjapXdIfQQI2GibAQIECBAgQIAAgVACgnaodimWAAEbbTNAgAABAgQIECBQuoCgXXqH1EeAgI22GSBAgAABAgQIEAglIGiHapdiCRCw0TYDBAgQIECAAAECpQsI2qV3SH0ECNhomwECBAgQIECAAIFQAoJ2qHYplgABG20zQIAAAQIECBAgULqAoF16h9RHgICNthkgQIAAAQIECBAIJSBoh2qXYgkQsNE2AwQIECBAgAABAqULCNqld0h9BAjYaJsBAgQIECBAgACBUAKCdqh2KZYAARttM0CAAAECBAgQIFC6gKBdeofUR4CAjbYZIECAAAECBAgQCCUgaIdql2IJELDRNgMECBAgQIAAAQKlCwjapXdIfQQI2GibAQIECBAgQIAAgVACgnaodimWAAEbbTNAgAABAgQIECBQuoCgXXqH1EeAgI22GSBAg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NAO1S7FEiBgo20GCBAgQIAAAQIEShcQtEvvkPoIELDRNgMECBAgQIAAAQKhBATtUO1SLAECNtpmgAABAgQIECBAoHQBQbv0DqmPAAEbbTNAgAABAgQIECAQSkDQDtUuxRIgYKNtBggQIECAAAECBEoXELRL75D6CBCw0TYDBAgQIECAAAECoQQE7VDtUiwBAjbaZoAAAQIECBAgQKB0AUG79A6pjwABG20zQIAAAQIECBAgEEpA0A7VLsUSIGCjbQYIECBAgAABAgRKFxC0S++Q+ggQsNE2AwQIECBAgAABAqEEBO1Q7VIsAQI22maAAAECBAgQIECgdAFBu/QOqY8AARttM0CAAAECBAgQIBBKQNAO1S7FEiBgo20GCBAgQIAAAQIEShcQtEvvkPoIELDRNgMECBAgQIAAAQKhBATtUO1SLAECNtpmgAABAgQIECBAoHQBQbv0DqmPAAEbbTNAgAABAgQIECAQSkDQDtUuxRIgYKNtBggQIECAAAECBEoXELRL75D6CBCw0TYDBAgQIECAAAECoQQE7VDtUiwBAjbaZoAAAQIECBAgQKB0AUG79A6pjwABG20zQIAAAQIECBAgEEpA0A7VLsUSIGCjbQYIECBAgAABAgRKFxC0S++Q+ggQsNE2AwQIECBAgAABAqEEBO1Q7VIsAQI22maAAAECBAgQIECgdIHRoN3f399ob29PnZ2dpdesPgIEaiowNDSURkZGUk9Pz+i/u2pK4doECBAgQIAAAQIFC4z+x2pXV9e0KVOmTJw8efK/Cq5XaQQI1FhgxowZs6dPnz5rcHBwao0ZXJ0AAQIECBAgQKBwAVuhwhukPAIECBAgQIAAAQIECBCIJSBox+qXagkQIECAAAECBAgQIECgcAFBu/AGKY8AAQIECBAgQIAAAQIEYgkI2rH6pVoCBAgQIECAAAECBAgQKFxA0C68QcojQIAAAQIECBAgQIAAgVgCgnasfqmWAAECBAgQIECAAAECBAoXELQLb5DyCBAgQIAAAQIECBAgQCCWwL8BPItRKSizOXEAAAAASUVORK5CYII=",
      "text/html": [
       "<img src= class=\"jupyter-widget\">\n",
       "<script type=\"application/vnd.jupyter-embedded-widgets\">[{},{\"color\":\"#AAAAAA\",\"height\":\"400px\",\"layout\":\"IPY_MODEL_d7e9cb1cba294eeaaa3410307ed7bade\",\"background_color\":\"black\",\"width\":\"800px\",\"font_family\":\"monospace\"},{},{\"color\":\"#AAAAAA\",\"layout\":\"IPY_MODEL_fa1d710e459d4c20ad1ff70eb86fa61c\",\"background_color\":\"black\",\"width\":\"800px\",\"font_family\":\"monospace\"},{\"flex_flow\":\"column\",\"display\":\"flex\"},{\"visible\":false,\"children\":[\"IPY_MODEL_8dd1573db74c4af38e222d263b17df2b\",\"IPY_MODEL_fc8c2961fba742e687d12f1cae61ace1\"],\"layout\":\"IPY_MODEL_59949acb0f5e4a979ff8c84d6ca19fdc\",\"padding\":\"10px\"},{},{\"layout\":\"IPY_MODEL_2f2460c77f3249e3a5b6939296f1342b\",\"description\":\"Start Console\"}]</script>"
      ]
     },
     "metadata": {
      "isWidgetSnapshot": true
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "toggle_button = widgets.Button(description=\"Start Console\")\n",
    "def toggle_console(sender):\n",
    "    console_container.visible = not console_container.visible\n",
    "    if console_container.visible:\n",
    "        toggle_button.description=\"Stop Console\"\n",
    "        input_box.disabled = False\n",
    "    else:\n",
    "        toggle_button.description=\"Start Console\"\n",
    "toggle_button.on_click(toggle_console)\n",
    "\n",
    "display(toggle_button)\n",
    "display(console_container)"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.4.3+"
  },
  "widgets": {
   "state": {
    "2f2460c77f3249e3a5b6939296f1342b": {
     "views": []
    },
    "59949acb0f5e4a979ff8c84d6ca19fdc": {
     "views": []
    },
    "6d5a4c43affe4d349e7338f4e04d3d34": {
     "views": [
      {
       "cell": {
        "cell_type": "code",
        "execution_count": 5,
        "metadata": {
         "collapsed": true,
         "trusted": true
        },
        "outputs": [
         {
          "data": {
           "image/png": "iVBORw0KGgoAAAANSUhEUgAAA9oAAAC/CAYAAAABxqQzAAAYTUlEQVR4Xu3dd2jd5RoH8Dc1JiriQgxqXGguKtZBoyC4tW5RUREHjrpw14W4B4gD0bonxT1wK4hat+LAaNX+16BWCGpEcaBoQui5vr+Lob20vbb3nOZ98vvkr15M3vO8n+e54jfP75y2JV8ECBAgQIAAAQIECBAgQIBA0wTamnaSgwgQIECAAAECBAgQIECAAIEkaBsCAgQIECBAgAABAgQIECDQRAFBu4mYjiJAgAABAgQIECBAgAABAoK2GSBAgAABAgQIECBAgAABAk0UELSbiOkoAgQIECBAgAABAgQIECAgaJsBAgQIECBAgAABAgQIECDQRIH5gnZfX9/RbW1t6zfxfEfVTKDRaMzp7e29v2bXdl0CBAgQIECAAAECBAiMCowG7YGBgcbw8HDq7OzEQ2CJBYaGhlJHR0fq7u72tMQSK/pBAgQIECBAgAABAgQiC4yGob+22Y1JkyZFvovaCxH4+OOP019bbUG7kH4ogwABAgQIECBAgACBpSsgaC9d71q8mqBdiza7JAECBAgQIECAAAECCxEQtI1G0wUE7aaTOpAAAQIECBAgQIAAgUACgnagZkUpVdCO0il1EiBAgAABAgQIECDQCgFBuxWqNT9T0K75ALg+AQIECBAgQIAAgZoLCNo1H4BWXF/QboWqMwkQIECAAAECBAgQiCIgaEfpVKA6Be1AzVIqAQIECBAgQIAAAQJNFxC0m07qQEHbDBAgQIAAAQIECBAgUGcBQbvO3W/R3QXtFsE6lgABAgQIECBAgACBEAKCdog2xSpS0I7VL9USIECAAAECBAgQINBcgWKD9gcffJBeeeWVtNJKK6V33nknDQ4Opnfffbe5t1/Eae+//356/fXX09prr52WWWaZ9Pvvv6cff/wxXXTRRS2v4aeffkp33XVX+vPPP9Pll1/e8tdr9gsI2s0WdR4BAgQIECBAgAABApEEigzaf/zxRzrssMPSE088kZZddtk0PDyczjjjjHTnnXdWtj/88EOaNWtW2nnnnRfLOgfnzTffPK2++uqL/LnnnnsuPf/88+n2229PnZ2d1ff++uuvVQ333XffYr3mkn7zY489lj777LN09dVXL+kRY/ZzgvaY0XthAgQIECBAgAABAgQKECgyaH/33XfpoIMOSg899FDaYIMNKqZXX3017bbbblXoPuecc9K+++6b9thjj39M+P3336djjjkmPfDAA4sM2r/88kvaZ5990g033JC22Wab+c7PNey6666prW2U7R+//uJ+47PPPps+/PBDQXtx4Xw/AQIECBAgQIAAAQIExligyKCdTfL2eObMmemkk05Khx56aLXZzl+ffvppuuqqq9Kmm26adtlll7Thhhume+65p/rfr732WrrgggvSCiusUD16nb9ycM7hfL/99kuXXnppOv7449N2222XNt544wXS5032lVdemfKj43+/5oK+8cEHH6z++cDAQFpxxRXTiSeemL788st0/fXXpx122CHNnj07ffLJJ+n0009PkydPTl988UVVX96QP/XUU9XGPH8t6JwJEyakeYP23Llz06OPPlo9wp7DfjbZeuutx3h0Fv7yNtrFtkZhBAgQIECAAAECBAgsBYFig3Z+f3J+VDwHzDXXXDNdfPHFqbe3tyKZOnVq2muvvaqNdn6UOwfeI444Il1zzTWpq6srHXvssWn69Onp7bffTnfccUfKG/K8Gc8BOwfYRT06fvfdd6eHH344vfXWWwvlf+GFF9KcOXOqEJ2/jjzyyLT//vunQw45JJ188slViD/zzDPTiy++WAXqfI8cwHP9O+20U1XDAQcckBZ1zrxBO/95ueWWS3vuuWd644030rXXXludnQN5iV+CdoldURMBAgQIECBAgAABAktLoNig/TfAV199VQXLzz//vHrse6ONNpovaOfvy0E6f3ha3hhvttlm1cb3kUceqbbIl1xyyajlPwnaeducX++9995L7e3tC+zDKaecUm2pDzzwwOqf33vvvdX2/bbbbpuvtr6+vnTTTTdVW+t83vnnn1/9guC4446rfiGwqHPmDdrnnntu2mKLLdIaa6yRfvvtt+qR8vyhbCuvvPLSmpPFeh1Be7G4fDMBAgQIECBAgAABAuNMoMignd9P/c0336Qtt9yy4h4ZG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2qHYplgABG20zQIAAAQIECBAgULqAoF16h9RHgICNthkgQIAAAQIECBAIJSBoh2qXYgkQsNE2AwQIECBAgAABAqULCNqld0h9BAjYaJsBAgQIECBAgACBUAKCdqh2KZYAARttM0CAAAECBAgQIFC6gKBdeofUR4CAjbYZIECAAAECBAgQCCUgaIdql2IJELDRNgMECBAgQIAAAQKlCwjapXdIfQQI2GibAQIECBAgQIAAgVACgnaodimWAAEbbTNAgAABAgQIECBQuoCgXXqH1EeAgI22GSBAgAABAgQIEAglIGiHapdiCRCw0TYDBAgQIECAAAECpQsI2qV3SH0ECNhomwECBAgQIECAAIFQAoJ2qHYplgABG20zQIAAAQIECBAgULqAoF16h9RHgICNthkgQIAAAQIECBAIJSBoh2qXYgkQsNE2AwQIECBAgAABAqULCNqld0h9BAjYaJsBAgQIECBAgACBUAKCdqh2KZYAARttM0CAAAECBAgQIFC6gKBdeofUR4CAjbYZIECAAAECBAgQCCUgaIdql2IJELDRNgMECBAgQIAAAQKlCwjapXdIfQQI2GibAQIECBAgQIAAgVACgnaodimWAAEbbTNAgAABAgQIECBQuoCgXXqH1EeAgI22GSBAgAABAgQIEAglIGiHapdiCRCw0TYDBAgQIECAAAECpQsI2qV3SH0ECNhomwECBAgQIECAAIFQAoJ2qHYplgABG20zQIAAAQIECBAgULqAoF16h9RHgICNthkgQIAAAQIECBAIJSBoh2qXYgkQsNE2AwQIECBAgAABAqULCNqld0h9BAjYaJsBAgQIECBAgACBUAKCdqh2KZYAARttM0CAAAECBAgQIFC6gKBdeofUR4CAjbYZIECAAAECBAgQCCUgaIdql2IJELDRNgMECBAgQIAAAQKlCwjapXdIfQQI2GibAQIECBAgQIAAgVACgnaodimWAAEbbTNAgAABAgQIECBQuoCgXXqH1EeAgI22GSBAgAABAgQIEAglIGiHapdiCRCw0TYDBAgQIECAAAECpQsI2qV3SH0ECNhomwECBAgQIECAAIFQAoJ2qHYplgABG20zQIAAAQIECBAgULqAoF16h9RHgICNthkgQIAAAQIECBAIJSBoh2qXYgkQsNE2AwQIECBAgAABAqULCNqld0h9BAjYaJsBAgQIECBAgACBUAKCdqh2KZYAARttM0CAAAECBAgQIFC6gKBdeofUR4CAjbYZIECAAAECBAgQCCUgaIdql2IJELDRNgMECBAgQIAAAQKlCwjapXdIfQQI2GibAQIECBAgQIAAgVACgnaodimWAAEbbTNAgAABAgQIECBQuoCgXXqH1EeAgI22GSBAgAABAgQIEAglIGiHapdiCRCw0TYDBAgQIECAAAECpQsI2qV3SH0ECNhomwECBAgQIECAAIFQAoJ2qHYplgABG20zQIAAAQIECBAgULqAoF16h9RHgICNthkgQIAAAQIECBAIJSBoh2qXYgkQsNE2AwQIECBAgAABAqULCNqld0h9BAjYaJsBAgQIECBAgACBUAKCdqh2KZYAARttM0CAAAECBAgQIFC6gKBdeofUR4CAjbYZIECAAAECBAgQCCUgaIdql2IJELDRNgMECBAgQIAAAQKlCwjapXdIfQQI2GibAQIECBAgQIAAgVACgnaodimWAAEbbTNAgAABAgQIECBQuoCgXXqH1EeAgI22GSBAgAABAgQIEAglIGiHapdiCRCw0TYDBAgQIECAAAECpQsI2qV3SH0ECNhomwECBAgQIECAAIFQAoJ2qHYplgABG20zQIAAAQIECBAgULqAoF16h9RHgICNthkgQIAAAQIECBAIJSBoh2qXYgkQsNE2AwQIECBAgAABAqULCNqld0h9BAjYaJsBAgQIECBAgACBUAKCdqh2KZYAARttM0CAAAECBAgQIFC6gKBdeofUR4CAjbYZIECAAAECBAgQCCUgaIdql2IJELDRNgMECBAgQIAAAQKlCwjapXdIfQQI2GibAQIECBAgQIAAgVACgnaodimWAAEbbTNAgAABAgQIECBQuoCgXXqH1EeAgI22GSBAgAABAgQIEAglIGiHapdiCRCw0TYDBAgQIECAAAECpQsI2qV3SH0ECNhomwECBAgQIECAAIFQAoJ2qHYplgABG20zQIAAAQIECBAgULqAoF16h9RHgICNthkgQIAAAQIECBAIJSBoh2qXYgkQsNE2AwQIECBAgAABAqULCNqld0h9BAjYaJsBAgQIECBAgACBU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oQQE7VDtUiwBAjbaZoAAAQIECBAgQKB0AUG79A6pjwABG20zQIAAAQIECBAgEEpA0A7VLsUSIGCjbQYIECBAgAABAgRKFxC0S++Q+ggQsNE2AwQIECBAgAABAqEEBO1Q7VIsAQI22maAAAECBAgQIECgdIHRoN3f399ob29PnZ2dpdesPgIEaiowNDSURkZGUk9Pz+i/u2pK4doECBAgQIAAAQIFC4z+x2pXV9e0KVOmTJw8efK/Cq5XaQQI1FhgxowZs6dPnz5rcHBwao0ZXJ0AAQIECBAgQKBwAVuhwhukPAIECBAgQIAAAQIECBCIJSBox+qXagkQIECAAAECBAgQIECgcAFBu/AGKY8AAQIECBAgQIAAAQIEYgkI2rH6pVoCBAgQIECAAAECBAgQKFxA0C68QcojQIAAAQIECBAgQIAAgVgCgnasfqmWAAECBAgQIECAAAECBAoXELQLb5DyCBAgQIAAAQIECBAgQCCWwL8BPItRKSizOXEAAAAASUVORK5CYII=",
           "text/html": "<img src= class=\"jupyter-widget\">\n<script type=\"application/vnd.jupyter-embedded-widgets\">[{},{\"color\":\"#AAAAAA\",\"height\":\"400px\",\"layout\":\"IPY_MODEL_d7e9cb1cba294eeaaa3410307ed7bade\",\"background_color\":\"black\",\"width\":\"800px\",\"font_family\":\"monospace\"},{},{\"color\":\"#AAAAAA\",\"layout\":\"IPY_MODEL_fa1d710e459d4c20ad1ff70eb86fa61c\",\"background_color\":\"black\",\"width\":\"800px\",\"font_family\":\"monospace\"},{\"flex_flow\":\"column\",\"display\":\"flex\"},{\"visible\":false,\"children\":[\"IPY_MODEL_8dd1573db74c4af38e222d263b17df2b\",\"IPY_MODEL_fc8c2961fba742e687d12f1cae61ace1\"],\"layout\":\"IPY_MODEL_59949acb0f5e4a979ff8c84d6ca19fdc\",\"padding\":\"10px\"},{},{\"layout\":\"IPY_MODEL_2f2460c77f3249e3a5b6939296f1342b\",\"description\":\"Start Console\"}]</script>"
          },
          "metadata": {
           "isWidgetSnapshot": true
          },
          "output_type": "display_data"
         }
        ],
        "source": "toggle_button = widgets.Button(description=\"Start Console\")\ndef toggle_console(sender):\n    console_container.visible = not console_container.visible\n    if console_container.visible:\n        toggle_button.description=\"Stop Console\"\n        input_box.disabled = False\n    else:\n        toggle_button.description=\"Start Console\"\ntoggle_button.on_click(toggle_console)\n\ndisplay(toggle_button)\ndisplay(console_container)"
       },
       "cell_index": 8,
       "root": true
      }
     ]
    },
    "8dd1573db74c4af38e222d263b17df2b": {
     "views": []
    },
    "d7e9cb1cba294eeaaa3410307ed7bade": {
     "views": []
    },
    "dcbbcc243ecf417fb08b3a37860ec1bb": {
     "views": [
      {
       "cell": {
        "cell_type": "code",
        "execution_count": 5,
        "metadata": {
         "collapsed": true,
         "trusted": true
        },
        "outputs": [
         {
          "data": {
           "image/png": "iVBORw0KGgoAAAANSUhEUgAAA9oAAAC/CAYAAAABxqQzAAAYTUlEQVR4Xu3dd2jd5RoH8Dc1JiriQgxqXGguKtZBoyC4tW5RUREHjrpw14W4B4gD0bonxT1wK4hat+LAaNX+16BWCGpEcaBoQui5vr+Lob20vbb3nOZ98vvkr15M3vO8n+e54jfP75y2JV8ECBAgQIAAAQIECBAgQIBA0wTamnaSgwgQIECAAAECBAgQIECAAIEkaBsCAgQIECBAgAABAgQIECDQRAFBu4mYjiJAgAABAgQIECBAgAABAoK2GSBAgAABAgQIECBAgAABAk0UELSbiOkoAgQIECBAgAABAgQIECAgaJsBAgQIECBAgAABAgQIECDQRIH5gnZfX9/RbW1t6zfxfEfVTKDRaMzp7e29v2bXdl0CBAgQIECAAAECBAiMCowG7YGBgcbw8HDq7OzEQ2CJBYaGhlJHR0fq7u72tMQSK/pBAgQIECBAgAABAgQiC4yGob+22Y1JkyZFvovaCxH4+OOP019bbUG7kH4ogwABAgQIECBAgACBpSsgaC9d71q8mqBdiza7JAECBAgQIECAAAECCxEQtI1G0wUE7aaTOpAAAQIECBAgQIAAgUACgnagZkUpVdCO0il1EiBAgAABAgQIECDQCgFBuxWqNT9T0K75ALg+AQIECBAgQIAAgZoLCNo1H4BWXF/QboWqMwkQIECAAAECBAgQiCIgaEfpVKA6Be1AzVIqAQIECBAgQIAAAQJNFxC0m07qQEHbDBAgQIAAAQIECBAgUGcBQbvO3W/R3QXtFsE6lgABAgQIECBAgACBEAKCdog2xSpS0I7VL9USIECAAAECBAgQINBcgWKD9gcffJBeeeWVtNJKK6V33nknDQ4Opnfffbe5t1/Eae+//356/fXX09prr52WWWaZ9Pvvv6cff/wxXXTRRS2v4aeffkp33XVX+vPPP9Pll1/e8tdr9gsI2s0WdR4BAgQIECBAgAABApEEigzaf/zxRzrssMPSE088kZZddtk0PDyczjjjjHTnnXdWtj/88EOaNWtW2nnnnRfLOgfnzTffPK2++uqL/LnnnnsuPf/88+n2229PnZ2d1ff++uuvVQ333XffYr3mkn7zY489lj777LN09dVXL+kRY/ZzgvaY0XthAgQIECBAgAABAgQKECgyaH/33XfpoIMOSg899FDaYIMNKqZXX3017bbbblXoPuecc9K+++6b9thjj39M+P3336djjjkmPfDAA4sM2r/88kvaZ5990g033JC22Wab+c7PNey6666prW2U7R+//uJ+47PPPps+/PBDQXtx4Xw/AQIECBAgQIAAAQIExligyKCdTfL2eObMmemkk05Khx56aLXZzl+ffvppuuqqq9Kmm26adtlll7Thhhume+65p/rfr732WrrgggvSCiusUD16nb9ycM7hfL/99kuXXnppOv7449N2222XNt544wXS5032lVdemfKj43+/5oK+8cEHH6z++cDAQFpxxRXTiSeemL788st0/fXXpx122CHNnj07ffLJJ+n0009PkydPTl988UVVX96QP/XUU9XGPH8t6JwJEyakeYP23Llz06OPPlo9wp7DfjbZeuutx3h0Fv7yNtrFtkZhBAgQIECAAAECBAgsBYFig3Z+f3J+VDwHzDXXXDNdfPHFqbe3tyKZOnVq2muvvaqNdn6UOwfeI444Il1zzTWpq6srHXvssWn69Onp7bffTnfccUfKG/K8Gc8BOwfYRT06fvfdd6eHH344vfXWWwvlf+GFF9KcOXOqEJ2/jjzyyLT//vunQw45JJ188slViD/zzDPTiy++WAXqfI8cwHP9O+20U1XDAQcckBZ1zrxBO/95ueWWS3vuuWd644030rXXXludnQN5iV+CdoldURMBAgQIECBAgAABAktLoNig/TfAV199VQXLzz//vHrse6ONNpovaOfvy0E6f3ha3hhvttlm1cb3kUceqbbIl1xyyajlPwnaeducX++9995L7e3tC+zDKaecUm2pDzzwwOqf33vvvdX2/bbbbpuvtr6+vnTTTTdVW+t83vnnn1/9guC4446rfiGwqHPmDdrnnntu2mKLLdIaa6yRfvvtt+qR8vyhbCuvvPLSmpPFeh1Be7G4fDMBAgQIECBAgAABAuNMoMignd9P/c0336Qtt9yy4h4ZGUlHHXVU2n333av3Wc+70X7zzTerkH3eeeelW265JS2//PL/V9DOj4Ln94fns/77Pdp5y95oNNJZZ52VJk2alE444YSqvhzO8/Y8h+p5a8tBe9q0adV7zfMdvv3223TzzTenjz76qNrUX3HFFQs9Z96gnc/MNW2//fajHvkPC/tFwFjPqKA91h3w+gQIECBAgAABAgQIjKVAkUE7/1Ve+cPI8qPgf3/w2Kmnnlo9or3tttums88+u3p/dg6eF154YRXA83uw8/a6u7u7CuX5k8P7+/vTZZddNuq74447pvxp3vk93IvaBucwnDfQ+bHzVVddtfr5oaGh9NJLL1WPiOdPQ3/yySerR8xz2L3xxhvTJptsUj3anR8Z33vvvavH2ucN2o8//ng6+OCDq/dZ5+Cc/5yD98LOmTdo5+18fs383vF11lmnevQ8WwjaY/l/Ha9NgAABAgQIECBAgACBBQsUG7TzJ3/nDzjLW+X8uPS6666bDj/88OoWOZzmjfBpp51WfdjZrbfeWr33Ob/3Om+3cxDPj5nnR8evu+661NPTU/1cDuL5MfP8CHd+BH1hX3lrnYPxyy+/nNZbb7201lprpdVWW60K2fn94PnDyXK4zmdNnDixeq90Dr5ff/119b7tXHP+0LVc5zPPPFM9Uv7000+nvKnPYT9/X649/9yCzsn3zb9kyB+oluvPvzzI7/HOQT/fMd8jP0pe6peNdqmdURcBAgQIECBAgAABAktDoMigvTQu7jVaJyBot87WyQQIECBAgAABAgQIlC8g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QIECAQOkCgnbpHVIfAQKCthkgQIAAAQIECBAIJSBoh2qXYgkQsNE2AwQIECBAgAABAqULCNqld0h9BAjYaJsBAgQIECBAgACBUAKCdqh2KZYAARttM0CAAAECBAgQIFC6gKBdeofUR4CAjbYZIECAAAECBAgQCCUgaIdql2IJELDRNgMECBAgQIAAAQKlCwjapXdIfQQI2GibAQIECBAgQIAAgVACgnaodimWAAEbbTNAgAABAgQIECBQuoCgXXqH1EeAgI22GSBAgAABAgQIEAglIGiHapdiCRCw0TYDBAgQIECAAAECpQsI2qV3SH0ECNhomwECBAgQIECAAIFQAoJ2qHYplgABG20zQIAAAQIECBAgULqAoF16h9RHgICNthkgQIAAAQIECBAIJSBoh2qXYgkQsNE2AwQIECBAgAABAqULCNqld0h9BAjYaJsBAgQIECBAgACBUAKCdqh2KZYAARttM0CAAAECBAgQIFC6gKBdeofUR4CAjbYZIECAAAECBAgQCCUgaIdql2IJELDRNgMECBAgQIAAAQKlCwjapXdIfQQI2GibAQIECBAgQIAAgVACgnaodimWAAEbbTNAgAABAgQIECBQuoCgXXqH1EeAgI22GSBAgAABAgQIEAglIGiHapdiCRCw0TYDBAgQIECAAAECpQsI2qV3SH0ECNhomwECBAgQIECAAIFQAoJ2qHYplgABG20zQIAAAQIECBAgULqAoF16h9RHgICNthkgQIAAAQIECBAIJSBoh2qXYgkQsNE2AwQIECBAgAABAqULCNqld0h9BAjYaJsBAgQIECBAgACBUAKCdqh2KZYAARttM0CAAAECBAgQIFC6gKBdeofUR4CAjbYZIECAAAECBAgQCCUgaIdql2IJELDRNgMECBAgQIAAAQKlCwjapXdIfQQI2GibAQIECBAgQIAAgVACgnaodimWAAEbbTNAgAABAgQIECBQuoCgXXqH1EeAgI22GSBAgAABAgQIEAglIGiHapdiCRCw0TYDBAgQIECAAAECpQsI2qV3SH0ECNhomwECBAgQIECAAIFQAoJ2qHYplgABG20zQIAAAQIECBAgULqAoF16h9RHgICNthkgQIAAAQIECBAIJSBoh2qXYgkQsNE2AwQIECBAgAABAqULCNqld0h9BAjYaJsBAgQIECBAgACBUAKCdqh2KZYAARttM0CAAAECBAgQIFC6gKBdeofUR4CAjbYZIECAAAECBAgQCCUgaIdql2IJELDRNgMECBAgQIAAAQKlCwjapXdIfQQI2GibAQIECBAgQIAAgVACgnaodimWAAEbbTNAgAABAgQIECBQuoCgXXqH1EeAgI22GSBAgAABAgQIEAglIGiHapdiCRCw0TYDBAgQIECAAAECpQsI2qV3SH0ECNhomwECBAgQIECAAIFQAoJ2qHYplgABG20zQIAAAQIECBAgULqAoF16h9RHgICNthkgQIAAAQIECBAIJSBoh2qXYgkQsNE2AwQIECBAgAABAqULCNqld0h9BAjYaJsBAgQIECBAgACBUAKCdqh2KZYAARttM0CAAAECBAgQIFC6gKBdeofUR4CAjbYZIECAAAECBAgQCCUgaIdql2IJELDRNgMECBAgQIAAAQKlCwjapXdIfQQI2GibAQIECBAgQIAAgVACgnaodimWAAEbbTNAgAABAgQIECBQuoCgXXqH1EeAgI22GSBAgAABAgQIEAglIGiHapdiCRCw0TYDBAgQIECAAAECpQsI2qV3SH0ECNhomwECBAgQIECAAIFQAoJ2qHYplgABG20zQIAAAQIECBAgULqAoF16h9RHgICNthkgQIAAAQIECBAIJSBoh2qXYgkQsNE2AwQIECBAgAABAqULCNqld0h9BAjYaJsBAgQIECBAgACBUAKCdqh2KZYAARttM0CAAAECBAgQIFC6gKBdeofUR4CAjbYZIECAAAECBAgQCCUgaIdql2IJELDRNgMECBAgQIAAAQKlCwjapXdIfQQI2GibAQIECBAgQIAAgVACgnaodimWAAEbbTNAgAABAgQIECBQuoCgXXqH1EeAgI22GSBAgAABAgQIEAglIGiHapdiCRCw0TYDBAgQIECAAAECpQsI2qV3SH0ECNhomwECBAgQIECAAIFQAoJ2qHYplgABG20zQIAAAQIECBAgULqAoF16h9RHgICNthkgQIAAAQIECBAIJSBoh2qXYgkQsNE2AwQIECBAgAABAqULCNqld0h9BAjYaJsBAgQIECBAgACBUAKCdqh2KZYAARttM0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ECBAgQKB0AUG79A6pjwABG20zQIAAAQIECBAgEEpA0A7VLsUSIGCjbQYIECBAgAABAgRKFxC0S++Q+ggQsNE2AwQIECBAgAABAqEEBO1Q7VIsAQI22maAAAECBAgQIECgdAFBu/QOqY8AARttM0CAAAECBAgQIBBKQNAO1S7FEiBgo20GCBAgQIAAAQIEShcQtEvvkPoIELDRNgMECBAgQIAAAQKhBATtUO1SLAECNtpmgAABAgQIECBAoHQBQbv0DqmPAAEbbTNAgAABAgQIECAQSkDQDtUuxRIgYKNtBggQIECAAAECBEoXELRL75D6CBCw0TYDBAgQIECAAAECoQQE7VDtUiwBAjbaZoAAAQIECBAgQKB0AUG79A6pjwABG20zQIAAAQIECBAgEEpA0A7VLsUSIGCjbQYIECBAgAABAgRKFxC0S++Q+ggQsNE2AwQIECBAgAABAqEEBO1Q7VIsAQI22maAAAECBAgQIECgdIHRoN3f399ob29PnZ2dpdesPgIEaiowNDSURkZGUk9Pz+i/u2pK4doECBAgQIAAAQIFC4z+x2pXV9e0KVOmTJw8efK/Cq5XaQQI1FhgxowZs6dPnz5rcHBwao0ZXJ0AAQIECBAgQKBwAVuhwhukPAIECBAgQIAAAQIECBCIJSBox+qXagkQIECAAAECBAgQIECgcAFBu/AGKY8AAQIECBAgQIAAAQIEYgkI2rH6pVoCBAgQIECAAAECBAgQKFxA0C68QcojQIAAAQIECBAgQIAAgVgCgnasfqmWAAECBAgQIECAAAECBAoXELQLb5DyCBAgQIAAAQIECBAgQCCWwL8BPItRKSizOXEAAAAASUVORK5CYII=",
           "text/html": "<img src= class=\"jupyter-widget\">\n<script type=\"application/vnd.jupyter-embedded-widgets\">[{},{\"color\":\"#AAAAAA\",\"height\":\"400px\",\"layout\":\"IPY_MODEL_d7e9cb1cba294eeaaa3410307ed7bade\",\"background_color\":\"black\",\"width\":\"800px\",\"font_family\":\"monospace\"},{},{\"color\":\"#AAAAAA\",\"layout\":\"IPY_MODEL_fa1d710e459d4c20ad1ff70eb86fa61c\",\"background_color\":\"black\",\"width\":\"800px\",\"font_family\":\"monospace\"},{\"flex_flow\":\"column\",\"display\":\"flex\"},{\"visible\":false,\"children\":[\"IPY_MODEL_8dd1573db74c4af38e222d263b17df2b\",\"IPY_MODEL_fc8c2961fba742e687d12f1cae61ace1\"],\"layout\":\"IPY_MODEL_59949acb0f5e4a979ff8c84d6ca19fdc\",\"padding\":\"10px\"},{},{\"layout\":\"IPY_MODEL_2f2460c77f3249e3a5b6939296f1342b\",\"description\":\"Start Console\"}]</script>"
          },
          "metadata": {
           "isWidgetSnapshot": true
          },
          "output_type": "display_data"
         }
        ],
        "source": "toggle_button = widgets.Button(description=\"Start Console\")\ndef toggle_console(sender):\n    console_container.visible = not console_container.visible\n    if console_container.visible:\n        toggle_button.description=\"Stop Console\"\n        input_box.disabled = False\n    else:\n        toggle_button.description=\"Start Console\"\ntoggle_button.on_click(toggle_console)\n\ndisplay(toggle_button)\ndisplay(console_container)"
       },
       "cell_index": 8,
       "root": true
      }
     ]
    },
    "fa1d710e459d4c20ad1ff70eb86fa61c": {
     "views": []
    },
    "fc8c2961fba742e687d12f1cae61ace1": {
     "views": []
    }
   },
   "version": "0.0.1"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 1
}
